home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK1.toast / Development Kits (Disc 1) / AppleTalk Wide Area / XTI Shell Sample Code / XTI includes / X25_Addr.h next >
Encoding:
C/C++ Source or Header  |  1992-08-17  |  3.6 KB  |  176 lines  |  [TEXT/MPS ]

  1. #ifndef __ISOTP_ADDR__
  2. #define __ISOTP_ADDR__ 
  3.  
  4. /*
  5.  *    General structure for addresses usable by ISO,TCP and X25
  6.  */
  7.  
  8.  
  9.  
  10. /* 
  11.  *    O S I   T R A N S P O R T   P R O V I D E R  N A M E S
  12.  */
  13.  
  14. #define OSI_CLNS_ETHERNET            "osi1"
  15. #define OSI_CONS_X25                "osi2"
  16. #define OSI_CLNS_TOKENRING            "osi3"
  17.  
  18. /* 
  19.  *    O S I   T R A N S P O R T   A D D R E S S   F O R M A T  
  20.  */
  21.  
  22.  
  23. /*
  24.  *  CLNS:
  25.  *    +-+---------------+-+----------+
  26.  *    !L!     TSEL      !L!   NSAP   !                                         Full ISO 8473 and ES/IS                        
  27.  *    +-+---------------+-+----------+
  28.  *
  29.  *    +-+----------------+-+----------+-+------+
  30.  *    !L!      TSEL      !L!   NSAP   !L! MAC  !                                 Full ISO 8473
  31.  *    +-+----------------+-+----------+-+------+
  32.  *
  33.  *    +-+----------------+-+----------+-+------+
  34.  *    !L!      TSEL      !L!          !L! MAC  !                                 Null IP (inactive subset)
  35.  *    +-+----------------+-+----------+-+------+
  36.  *
  37.  *  CONS:
  38.  *    +-+----------------+-+----------+-+-+--------+-+----------------+-+---+
  39.  *    !L!      TSEL      !L!   NSAP   !L!L! X.121  !L!      CUD       !L!CUG!    Use AEF to convey NSAP                
  40.  *    +-+----------------+-+----------+-+-+--------+-+----------------+-+---+    ( Optionally CUD and/or CUG )
  41.  *
  42.  *    +-+----------------+-+----------+-+-+--------+-+----------------+-+---+
  43.  *    !L!      TSEL      !L!          !L!L! X.121  !L!      CUD       !L!CUG!    No NSAP, use X.121 address instead                
  44.  *    +-+----------------+-+----------+-+-+--------+-+----------------+-+---+    ( Optionally CUD and/or CUG )
  45.  */
  46.  
  47.  
  48.  
  49. /*
  50.  *    T S E L  ( T r a n s p o r t  S E L e c t o r )
  51.  */
  52. #define cMaxTSELlenInDigit        64
  53. #define cMaxTSELlenInOctet        32
  54.  
  55. typedef struct {
  56.     unsigned char len;        /* In Semi Octets    */                 
  57.     unsigned char sel[cMaxTSELlenInOctet];
  58. } TTSEL;
  59.  
  60.  
  61.  
  62.  
  63. /*
  64.  *    N S A P  ( N e t w o r k  S e r v i c e  A c c e s s  P o i n t )
  65.  */
  66. #define cMaxNSAPLenInDigit        40
  67. #define cMaxNSAPLenInOctet        20
  68.  
  69. typedef struct {
  70.     unsigned char len;         /* In Semi Octets    */
  71.     unsigned char addr[cMaxNSAPLenInOctet];
  72. } TNSAP;
  73.  
  74.  
  75.  
  76.  
  77.  
  78. /*
  79.  *    S N P A
  80.  */
  81.  
  82.  
  83. /*
  84.  *    Subnet specific address format(s)
  85.  */
  86.  
  87. /*
  88.  * MAC Address Field format
  89.  */
  90. #define    cMACaddrLenInDigit        12            /*    MAC address len (in semi octets)        */
  91. #define cMACaddrLenInOctet         6            /*    MAC address len (in octets)            */
  92.  
  93. typedef struct {
  94.     unsigned char len;        /* In Semi Octets (always 12) */ 
  95.     unsigned char addr[cMACaddrLenInOctet];
  96. } TMACaddr;        
  97.  
  98.  
  99. /*
  100.  * X.121 DTE Address Field format
  101.  */
  102. #define    cMaxX121addrLenInDigit    15            /*    Max X.121 address len (in semi octets)        */
  103. #define cMaxX121addrLenInOctet     8            /*    Max X.121 address len (in octets)            */
  104.  
  105. typedef struct {
  106.     unsigned char len;        /* In Semi Octets    */ 
  107.     unsigned char addr[cMaxX121addrLenInOctet];
  108. } TX121; 
  109.  
  110.  
  111. /*
  112.  *    Call User Data format
  113.  */
  114. #define cMaxCUDlenInDigit        32
  115. #define cMaxCUDlenInOctet        16
  116.  
  117. typedef struct {
  118.         unsigned char len;        /* In Semi Octets    */ 
  119.         unsigned char data[cMaxCUDlenInOctet];
  120. } TCUD; 
  121.  
  122. /*
  123.  *    Closed User Group format
  124.  */
  125. #define cMaxCUGlenInDigit        4
  126. #define cMaxCUGlenInOctet        2
  127.  
  128. typedef struct {
  129.         unsigned char len;        /* In Semi Octets    */ 
  130.         unsigned char data[cMaxCUGlenInOctet];
  131. } TCUG; 
  132.  
  133.  
  134. /*
  135.  *    DTE address (X.121 + CUD + CUG)
  136.  */
  137. typedef struct {
  138.     TX121    X121Addr;
  139.     TCUD    CUD;
  140.     TCUG    CUG;
  141. } TDTEaddr;    
  142.  
  143.  
  144.  
  145. /*
  146.  *    Subnet independent address format
  147.  */
  148. typedef struct {
  149.     unsigned char    len;        /* In Semi Octets (0 means no SNPA address)        */ 
  150.     unsigned char addr[];        /* Defined by Subnet Specific Address Format    */
  151. } TSNPA;
  152.  
  153.  
  154. /*
  155.  *    Subnet Specific Address Format
  156.  */
  157. typedef union {
  158.         TSNPA            snpa;
  159.         TMACaddr        MACaddr;
  160.         TDTEaddr        DTEaddr;            
  161. } TSSAF;
  162.  
  163.  
  164.  
  165.  
  166. /*
  167.  *    T S A P  ( T r a n s p o r t  S e r v i c e  A c c e s s  P o i n t )
  168.  */
  169.  
  170. typedef struct {
  171.     TTSEL     tsel;    
  172.     TNSAP     nsap;    /* Optional            */    
  173.     TSSAF    ssaf;    /* Optional            */
  174. } TTSAP;    
  175.  
  176. #endif